<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <title>注册 - 极简论坛</title>
    <link rel="stylesheet" href="css/style.css">
</head>
<body>
<div class="container">
    <h1>注册</h1>
    <% if (request.getAttribute("error") != null) { %>
    <div class="error"><%= request.getAttribute("error") %></div>
    <% } %>
    <form action="RegisterServlet" method="post">
        <div class="form-group">
            <label for="username">用户名</label>
            <input type="text" id="username" name="username" required>
        </div>
        <div class="form-group">
            <label for="password">密码</label>
            <input type="password" id="password" name="password" required>
            <div class="password-rules">
                密码必须：
                <ul>
                    <li>长度在6-20个字符之间</li>
                    <li>包含以下四种字符中的至少三种：大写字母、小写字母、数字、特殊字符(仅限"_","@","%",".","-")</li>
                </ul>
            </div>
        </div>
        <div class="form-group">
            <label for="confirmPassword">确认密码</label>
            <input type="password" id="confirmPassword" name="confirmPassword" required>
        </div>
        <button type="submit">注册</button>
    </form>
    <p>已有账号？<a href="login.jsp">立即登录</a></p>
    <p><a href="index.jsp">返回首页</a></p>
</div>
</body>
</html>